function [ out ] = fun_dsigma(theta,argument,m_regr,combos_all,ind)

v_regr = combos_all-1;
    
    v_regr_minus1 = v_regr;
    v_regr_minus1(:,ind) = v_regr_minus1(:,ind)-1;
    
    v_regr_plus1 = v_regr;
    v_regr_plus1(:,ind) = v_regr_plus1(:,ind)+1;

B_der = (prod(BernsteinElement_2(v_regr_minus1,m_regr,argument'),3).*(m_regr(ind)-v_regr_minus1(:,ind)) +...
        prod(BernsteinElement_2(v_regr,m_regr,argument'),3).*(2*v_regr(:,ind)-m_regr(ind)) -...
        prod(BernsteinElement_2(v_regr_plus1,m_regr,argument'),3).*v_regr_plus1(:,ind));

out = B_der'*theta;

end